#include <stdio.h>
#include <math.h>
int main()
{
    int t,a[500000],i,j;
    for (i=2;i<=500000;i++)a[i]=1;
    for (i=2;i<=500000/2;i++)
        for (j=2;j*i<=500000;j++)
            a[i*j]+=i;
    a[1]=a[0]=0;
    scanf("%d",&t);
    while (t--)
    {
        int n;
        scanf("%d",&n);
        printf("%d\n",a[n]);
    }
    return 0;
}
